package pe.edu.sistemas.samupg.view.managedbeans;

import java.io.File;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;

import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

@ManagedBean
@RequestScoped
public class TemplatePrincipalController {

	private List<String> imagenes;

	@PostConstruct
	public void init() {
		imagenes = new ArrayList<String>();
		String ruta = "resources" + File.separator + "images" + File.separator
				+ "slides";
		System.out.println(ruta);

		String rutaImagen;
		for (int i = 0; i < 3; i++) {
			rutaImagen = ruta + File.separator + "slide" + (i + 1) + ".jpg";
			imagenes.add(i, rutaImagen);
		}
	}

	public String getFechaActual() {
		SimpleDateFormat sdf = new SimpleDateFormat(
				"EEEE dd 'de' MMMM 'del' yyyy", new Locale("es"));
		return sdf.format(new Date());
	}

	public List<String> getImagenesCabecera() {
		return imagenes;
	}
}
